<!--
 * @Author: LiuShuang
 * @Date: 2023-03-03 10:01:46
 * @FilePath: \network\src\components\common\pagination.vue
 * @Description:
-->
<template>
	<div class="pageBox" >
		<span style="margin-right: 20px;font-size: 13px;">共{{total}}条</span>
		<span style="font-size: 13px;">每页{{pageSize}}条</span>
		<el-pagination
		  @current-change="handleCurrentChange"
		  :current-page.sync="pageIndex"
		  :page-size="pageSize"
		  layout="prev, pager, next, jumper"
		  :total="total">
		</el-pagination>
	</div>
</template>

<script>
	export default{
		props:['total','PageSize','PageIndex'],
		watch: {
			PageIndex(newPageIndex, oldPageIndex) {
				this.pageIndex = newPageIndex;
			}
		},
		data(){
			return{
				// currentPage3: 1,
				pageSize:this.PageSize,
				pageIndex:this.PageIndex
			}
		},
		methods:{
			handleCurrentChange(val){
				this.$emit('handleCurrentChange',val)
			}
		}
	}
</script>

<style>
	.pageBox{
		text-align: center;
		margin-top: 20px;
		margin-right: 25px;
		display: flex;
		align-items: center;
		justify-content: flex-end;
	}
</style>
